﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CategoryList.aspx.cs" Inherits="X.WebSite.Admin.Product.CategoryList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    产品类别<a href="CategoryDetail.aspx">新增</a>
    <asp:GridView ID="gvCategoryList" runat="server" AutoGenerateColumns="False" EnableModelValidation="True"
        OnRowDeleting="gvCategoryList_RowDeleting" DataKeyNames="CategoryId">
        <Columns>
            <asp:BoundField DataField="CategoryName" HeaderText="类别名称" HtmlEncode="false" />
            <asp:TemplateField>
                <ItemTemplate>
                    <a href="../../Product/<%# X.Common.StringUtils.HtmlDecode(Eval("CategoryName").ToString()).Replace(" ","-") %>/"
                        target="_blank">前台页面</a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <%# Convert.ToBoolean(Eval("ShowOnMenu")) ? "导航" : "类别"%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataFormatString="共({0})个产品" DataField="ProductCount" />
            <asp:TemplateField HeaderText="标题">
                <ItemTemplate>
                    <%# Eval("Title") != "" ? "√" : "×"%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="关键字">
                <ItemTemplate>
                    <%# Eval("Keyword") != "" ? "√" : "×"%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="描述">
                <ItemTemplate>
                    <%# Eval("Descript") != "" ? "√" : "×"%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="特殊类别">
                <ItemTemplate>
                    <%# Eval("ParentCategoryId") == "0" ? "√" : "×"%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="显示">
                <ItemTemplate>
                    <%# Convert.ToBoolean(Eval("IsShow"))? "√" : "×"%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="排序" DataField="OrderNum" />
            <asp:HyperLinkField DataNavigateUrlFields="CategoryId" DataNavigateUrlFormatString="CategoryDetail.aspx?CategoryId={0}"
                Text="编辑" />
            <asp:HyperLinkField DataNavigateUrlFields="CategoryId" DataNavigateUrlFormatString="List.aspx?CategoryId={0}"
                Text="下属产品" />
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
    </asp:GridView>
    </form>
</body>
</html>
